import React, { PureComponent, createContext, forwardRef } from 'react'
import ReactDOM from 'react-dom'

export default class Test extends PureComponent {
  render() {
    return (
      <>
        <div>Test</div>
        <Modal>
          <div style={{ width: '200px', height: '200px' }}>22</div>
        </Modal>
      </>
    )
  }
}

function Modal(props) {
  return ReactDOM.createPortal(<>{props.children}</>, document.getElementById('modal'))
}
